/**
 * @file PauseState.cpp
 *
 * Implementación de PauseState.h
 *
 * @see PauseState.h
 */

#include <PlayState.h>
#include <PauseState.h>

template<> PauseState* Ogre::Singleton<PauseState>::ms_Singleton = 0;

PauseState::PauseState() {}

PauseState::~PauseState() throw() {}

void PauseState::enter() {
  _exitGame = false; }

void PauseState::exit() {}

void PauseState::pause() {}

void PauseState::resume() {}

bool PauseState::frameStarted(const Ogre::FrameEvent& evt) {
  return true; }

bool PauseState::frameEnded(const Ogre::FrameEvent& evt) {
  return not _exitGame; }

void PauseState::keyPressed(const OIS::KeyEvent& e)
{
  if (e.key == OIS::KC_ESCAPE)
    _exitGame = true;

  else if (e.key == OIS::KC_P)
    GameManager::getSingletonPtr()->popState();
}

void PauseState::keyReleased(const OIS::KeyEvent& e) {}

void PauseState::mouseMoved(const OIS::MouseEvent& e) {}

void PauseState::mousePressed(const OIS::MouseEvent& e, OIS::MouseButtonID id) {}

void PauseState::mouseReleased(const OIS::MouseEvent& e, OIS::MouseButtonID id) {}

PauseState* PauseState::getSingletonPtr() { return ms_Singleton; }

PauseState& PauseState::getSingleton()
{
  assert(ms_Singleton);
  return *ms_Singleton;
}
